Skip to content

Loosen group placement lock to the last group match - #5

Merged
borland667 merged 1 commit into
mainfrom
ux/loosen-group-placement-lock
Jun 15, 2026
Merged

Loosen group placement lock to the last group match#5
borland667 merged 1 commit into
mainfrom
ux/loosen-group-placement-lock

Conversation

@borland667

Copy link
Copy Markdown
Owner

Summary

By matchday 1 of a tournament, every group already shows "Grupo bloqueado — ya arrancó el primer partido" on the Predict page, which makes it impossible to refine 1°/2°/3° picks as the rest of the group plays out — even though most of those fixtures haven't kicked off yet.

This PR loosens the group-level cutoff to the latest per-match-safe point: a group's placement card stays editable while any of its group-stage matches is still unlocked, and only locks once every such match has kicked off or been manually closed by an admin. Placement still locks before any match has finished, so it stays a genuine prediction — but the user can keep refining picks throughout matchdays 1 and 2.

Per-match locking semantics are unchanged: each individual match still locks at its own kickoff or when admin closes it. Only the derived group-level lock changes.

What changed

  • api/locking.cjsisGroupPredictionLocked now requires every group-stage match in the group to be locked before reporting the group as locked; comment + module header updated to describe the new cutoff
  • i18n: predict.groupLocked rewritten in en / es / pt / it / nl to read "last group match kicked off" instead of "first match kicked off" (Spanish: "ya arrancó el último partido del grupo")
  • docs/ARCHITECTURE.md §7.5 — locking rules now describe the per-match-safe cutoff and the consequence for groups containing matchDate = null matches
  • docs/QA_CHECKLIST.md §11.1 / §11.2 — manual lock test now explicitly exercises a partially-started group vs. a fully-started group, and the admin closure step calls out that closing one group-stage match no longer locks the whole group on its own
  • tests/locking.test.mjs — three new unit cases:
    • partially-started group stays open
    • group locks once every group-stage match has kicked off
    • closing only one of multiple admin-closeable matches does NOT lock the group

Integrity note

Under the new rule, by the time a group's placement card locks, 5 of the 6 fixtures in a 4-team group have already been played. The final 6th match is still uncertain, so placement remains a prediction. This was the user's explicit preference over the more lenient "lock after all matches finish" option (which would have trivialized the placement scoring).

Test plan

  • npm run lint — clean
  • node --test tests/locking.test.mjs — 11/11 pass, including the 3 new cases
  • npm test — full suite 50/50 pass (verified pre-cherry-pick on the parent branch)
  • Manual: reload Predict on the seeded WC2026, confirm group cards no longer show locked while at least one fixture is in the future, and that the pill copy now reads "last group match kicked off" in each language

Made with Cursor

Previously a group's 1°/2°/3° placement card locked as soon as the
first group-stage match between two of its teams kicked off. By
matchday 1 every group already shows "Grupo bloqueado", which makes
it impossible to refine placement picks as the matchdays unfold even
when most fixtures are still in the future.

Move the cutoff to the latest per-match-safe point: a group now stays
editable while *any* of its group-stage matches is still unlocked,
and only locks once every such match has kicked off or been manually
closed by an admin. Placement therefore stays a genuine prediction
(one fixture is still uncertain when the lock fires) without trivially
giving the user the final standings.

Per-match locking semantics are unchanged: each individual match
still locks at its own kickoff or when admin closes it. The relaxed
rule only governs the derived group-level lock.

i18n strings updated in en / es / pt / it / nl. ARCHITECTURE §7.5
and QA_CHECKLIST §11.1/§11.2 updated to describe the new cutoff and
to add a mixed-state test step. New unit coverage in locking.test.mjs
verifies that a partially-started group stays open, that the group
locks once every match has started, and that a single admin-closed
match no longer locks the whole group on its own.

Co-authored-by: Cursor <cursoragent@cursor.com>
@borland667
borland667 merged commit cac3999 into main Jun 15, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant